package flatlandRPG;

import org.lwjgl.util.vector.Vector2f;

// -------------------------------------------------------------------------
/**
 * A class of utility vector methods.
 *
 * @author evant
 * @version May 1, 2011
 */
public class VectorUtil
{
    // ----------------------------------------------------------
    /**
     * Calculates the distance between two vectors.
     *
     * @param v1
     *            the first vector
     * @param v2
     *            the second vector
     * @return the distance between them
     */
    public static float distance(Vector2f v1, Vector2f v2)
    {
        Vector2f distanceVector = new Vector2f();
        Vector2f.sub(v2, v1, distanceVector);
        return distanceVector.length();
    }
}
